package com.yst.metho.web.application.components.doublelist;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

import nextapp.echo2.app.list.AbstractListModel;
import nextapp.echo2.app.list.ListModel;

//public class DoubleListModel extends AbstractSuiviTableModel

public class DoubleListModel extends AbstractListModel implements ListModel
{

	private Collection mList;

	public DoubleListModel(ArrayList lst)
	{
		mList = lst;
	}

	public int size()
	{
		int retour = 0;
		if (null != mList)
		{
			retour = mList.size();
		}
		return retour;
	}

	public Object get(int row)
	{
		Object retour = null;
		Iterator it = mList.iterator();
		int i = -1;
		do
		{
			retour = it.next();
			i++;
		}
		while (i != row);
		return retour;
	}

	public void refresh()
	{
		fireContentsChanged(0, mList.size());
	}
}
